function plotImpulseResponse_yieldCurveFactors(IRFyAll,labely,labelne,shockSize,order_app)

fontSizeValue   = 14;
figureSize      =  [0 0 1300 600+300]; % (0,0) size in x size in y

% Some dimensions
ne = size(shockSize,1);
% nx = size(IRFx,1);
% length = size(IRFx,2);


% Figures and x-axis
dimX        = 0:size(IRFyAll,2);

% min and max per impulse response function 
minValues = zeros(1,size(IRFyAll,1));
maxValues = zeros(1,size(IRFyAll,1));
for i=1:size(IRFyAll,1)
    minValues(1,i) = min(min(min(IRFyAll(i,:,[1 3],:))));
    maxValues(1,i) = max(max(max(IRFyAll(i,:,[1 3],:))));
end

figure('NumberTitle','off','Name',['Yield Curve Factors'],'Position',figureSize);
idx = 0;
for j=1:length(labely)
    for i=1:ne
        idx = idx + 1;
        subplot(length(labely),ne,idx)
        hold on
        plot (dimX,[0 squeeze(IRFyAll(j,:,order_app,i))],'-ko');
        plot (dimX,[0 squeeze(IRFyAll(j,:,1,i))],'--k');
        axis([min(dimX) max(dimX) minValues(1,j) maxValues(1,j)])
        set(gca,'FontSize',fontSizeValue)
        if j == 1
            title(char(labelne(i)),'Interpreter','Latex','FontSize',fontSizeValue);
            set(gca,'FontSize',fontSizeValue)
        end
        if j == 1 && i == 1
            %legend({'$\gamma_{\pi} = \hat{\gamma_{\pi}}$','$\gamma_{\pi }=0$'},'Orientation','horisontal','Location','NorthEast','EdgeColor',[1 1 1],...
            %    'Interpreter','Latex','FontSize',fontSizeValue+2);
            legend({'$M^{M,CS}$','$M^{M,CS}$ with $\omega_{d}=0$'},'Orientation','horizontal','Location','NorthEast','EdgeColor',[1 1 1],...
                'Interpreter','Latex','FontSize',fontSizeValue+2);
            
        end
        if i == 1
            ylabel(char(labely(j)),'Interpreter','Latex','FontSize',fontSizeValue+2)
        end
        hold off
    end
end
    
    
end